package cn.com.dcsgo.service;

import cn.com.dcsgo.model.acl.Role;
import cn.com.dcsgo.vo.acl.RoleQueryVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.Map;

/**
 * RoleService
 *
 * @author Dcsgo
 * @since 2025/3/18 14:03
 */

public interface RoleService extends IService<Role> {
    /**
     * 条件分页查询
     *
     * @param pageParam   pageParam
     * @param roleQueryVo roleQueryVo
     * @return IPage->Role
     */
    IPage<Role> selectRolePage(Page<Role> pageParam, RoleQueryVo roleQueryVo);

    /**
     * 获取所有角色及其用户已分配的角色
     *
     * @param adminId adminId
     * @return Map->allRolesList,assignRoles
     */
    Map<String, Object> selectRolesAndAssigned(Long adminId);

    /**
     * 通过用户 id 批量添加角色
     * @param adminId  adminId
     * @param roleIds roleIds
     * @return 成功true 失败false
     */
    boolean saveAdminRoles(Long adminId, Long[] roleIds);
}
